import _sfc_main from "./index.vue2.mjs";
import { resolveComponent, createElementBlock, openBlock, createVNode, withCtx, createElementVNode, createCommentVNode, TransitionGroup, Fragment, renderList, renderSlot, createTextVNode, toDisplayString } from "vue";
import _export_sfc from "../../_virtual/_plugin-vue_export-helper.mjs";
const _hoisted_1 = { class: "ep-container" };
const _hoisted_2 = { class: "ep-correlation-container" };
const _hoisted_3 = ["tabindex"];
const _hoisted_4 = {
  key: 0,
  class: "ep-footer"
};
const _hoisted_5 = {
  key: 0,
  class: "ep-correlation__tip"
};
const _hoisted_6 = { class: "dialog-footer" };
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
  const _component_Plus = resolveComponent("Plus");
  const _component_el_button = resolveComponent("el-button");
  const _component_el_form_item = resolveComponent("el-form-item");
  const _component_el_dialog = resolveComponent("el-dialog");
  return openBlock(), createElementBlock("div", _hoisted_1, [
    createVNode(_component_el_form_item, {
      label: _ctx.options.label,
      prop: _ctx.options.name,
      "show-message": !_ctx.isDetail,
      class: "ep-form-item"
    }, {
      default: withCtx(() => [
        createElementVNode("div", _hoisted_2, [
          createVNode(TransitionGroup, {
            tag: "ul",
            class: "correlation-list",
            name: "list"
          }, {
            default: withCtx(() => [
              (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.fieldModel, (obj, i) => {
                return openBlock(), createElementBlock("li", {
                  key: i,
                  class: "correlation-item",
                  tabindex: i
                }, [
                  renderSlot(_ctx.$slots, "default", {
                    item: obj,
                    remove: () => _ctx.fieldModel.splice(i, 1)
                  })
                ], 8, _hoisted_3);
              }), 128))
            ]),
            _: 3
          }),
          !_ctx.isDetail ? (openBlock(), createElementBlock("div", _hoisted_4, [
            renderSlot(_ctx.$slots, "btn", {}, () => [
              createVNode(_component_el_button, {
                plain: "",
                onClick: _cache[0] || (_cache[0] = ($event) => _ctx.dialogVisible = true)
              }, {
                icon: withCtx(() => [
                  createVNode(_component_Plus)
                ]),
                default: withCtx(() => [
                  _cache[3] || (_cache[3] = createTextVNode(" 添加审批 ", -1))
                ]),
                _: 1
              })
            ]),
            renderSlot(_ctx.$slots, "tip", {}, () => [
              _ctx.options.tip ? (openBlock(), createElementBlock("div", _hoisted_5, toDisplayString(_ctx.options.tip), 1)) : createCommentVNode("", true)
            ])
          ])) : createCommentVNode("", true)
        ])
      ]),
      _: 3
    }, 8, ["label", "prop", "show-message"]),
    createVNode(_component_el_dialog, {
      modelValue: _ctx.dialogVisible,
      "onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => _ctx.dialogVisible = $event),
      title: "选择关联审批",
      class: "correlation-dialog",
      "append-to-body": ""
    }, {
      footer: withCtx(() => [
        createElementVNode("span", _hoisted_6, [
          createVNode(_component_el_button, {
            onClick: _cache[1] || (_cache[1] = ($event) => _ctx.dialogVisible = false)
          }, {
            default: withCtx(() => [..._cache[4] || (_cache[4] = [
              createTextVNode("取消", -1)
            ])]),
            _: 1
          }),
          createVNode(_component_el_button, {
            type: "primary",
            onClick: _ctx.onSave
          }, {
            default: withCtx(() => [..._cache[5] || (_cache[5] = [
              createTextVNode(" 确定 ", -1)
            ])]),
            _: 1
          }, 8, ["onClick"])
        ])
      ]),
      default: withCtx(() => [
        renderSlot(_ctx.$slots, "dialog", {
          options: _ctx.options,
          callback: _ctx.onCallback
        })
      ]),
      _: 3
    }, 8, ["modelValue"])
  ]);
}
const Index = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
export {
  Index as default
};
